package Static_Block;

//了解静态代码块 static{}
//了解实例代码块 {}
public class Test {
    public static void main(String[] args) {
        //静态代码块会在调用整个Student类时就执行一次,并且以后再次调用也只执行一次
        System.out.println(Student.number);
        System.out.println(Student.number);
        System.out.println(Student.number);
        System.out.println(Student.schoolName);

        System.out.println("=========================");

        //实例代码块也会在调用整个Student类时就执行,且每次调用都会执行,(会在构造器执行前执行)
        Student s1 = new Student();
        Student s2 = new Student("123");

    }
}
